﻿<UserControl x:Class="ContactTracing.Controls.ErrorPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:ContactTracing.WPF.Properties"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignWidth="500">
    <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}"
            Padding="20">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1">
                <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                <StackPanel Orientation="Horizontal">
                    <StackPanel Grid.Column="0" Margin="0, 0, 10, 0" VerticalAlignment="Center">
                        <Path Width="24" Height="24" Stretch="Fill" Fill="Tomato" Data="F1 M 58.5832,55.4172L 17.4169,55.4171C 15.5619,53.5621 15.5619,50.5546 17.4168,48.6996L 35.201,15.8402C 37.056,13.9852 40.0635,13.9852 41.9185,15.8402L 58.5832,48.6997C 60.4382,50.5546 60.4382,53.5622 58.5832,55.4172 Z M 34.0417,25.7292L 36.0208,41.9584L 39.9791,41.9583L 41.9583,25.7292L 34.0417,25.7292 Z M 38,44.3333C 36.2511,44.3333 34.8333,45.7511 34.8333,47.5C 34.8333,49.2489 36.2511,50.6667 38,50.6667C 39.7489,50.6667 41.1666,49.2489 41.1666,47.5C 41.1666,45.7511 39.7489,44.3333 38,44.3333 Z "/>
                    </StackPanel>

                    <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="ERROR" />
                </StackPanel>
            </StackPanel>

            <StackPanel Grid.Row="1" Height="10"/>

            
            <StackPanel Grid.Row="2">
                <TextBlock Text="{Binding ErrorMessage, FallbackValue=Error}" Grid.Row="2" TextWrapping="Wrap" />
                <StackPanel Height="10" />
                <TextBox IsReadOnly="True" Text="{Binding ErrorMessageDetail}" Height="140" VerticalScrollBarVisibility="Visible" Grid.Row="2" TextWrapping="Wrap" />
            </StackPanel>

            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Grid.ColumnSpan="4"
                        IsEnabled="{Binding TaskbarProgressValue, Converter={StaticResource ProgressBarStartButtonEnabledConverter}}">
                <Button Style="{StaticResource PanelCloseButtonStyle}" Margin="0" Command="{Binding ErrorAcceptCommand}" />
            </StackPanel>

            <StackPanel Margin="0, 10, 0, 0" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Height="Auto" Content="{x:Static p:Resources.OK}" Command="{Binding ErrorAcceptCommand}" />
                <!--<StackPanel Width="10" />
                <Button Height="Auto" Click="btnClose_Click" Content="{x:Static p:Resources.Cancel}" />-->
            </StackPanel>
        </Grid>
    </Border>
</UserControl>